/*
 * @Author: weikang
 * @Description:
 * @Date: 2023-12-22 09:42:59
 * @LastEditTime: 2024-04-09 13:46:51
 * @FilePath: \env-manager-pc\src\router\modules\document.ts
 */
import type { RouteRecordRaw } from 'vue-router'

function Layout() {
  return import('@/layouts/index.vue')
}

const routes: RouteRecordRaw = {
  path: '/document',
  component: Layout,
  redirect: '/document/statistics',
  name: 'document',
  meta: {
    title: '档案管理',
    icon: 'ep:folder-opened',
  },
  children: [
    {
      path: 'statistics',
      name: 'document-statistics',
      component: () => import('@/views/document/statistics/index.vue'),
      meta: {
        title: '档案统计',
        auth: '/document/statistics',
      },
    },
    {
      path: 'manager',
      name: 'document-manager',
      redirect: '/document/manager',
      meta: {
        title: '档案维护',
      },
      children: [
        {
          path: '',
          name: 'document-manager-list',
          component: () => import('@/views/document/manager/index.vue'),
          meta: {
            title: '档案维护',
            sidebar: false,
            breadcrumb: false,
            activeMenu: '/document/manager',
            auth: ['/document/manager/create', '/document/manager/modify/:id', '/document/manager/detail/:id'],
          },
        },
        {
          path: 'create',
          name: 'document-manager-create',
          component: () => import('@/views/document/manager/create/index.vue'),
          meta: {
            title: '档案创建',
            sidebar: false,
            activeMenu: '/document/manager',
            auth: '/document/manager/create',
          },
        },
        {
          path: 'modify/:id',
          name: 'document-manager-modify',
          component: () => import('@/views/document/manager/create/index.vue'),
          meta: {
            title: '档案编辑',
            sidebar: false,
            activeMenu: '/document/manager',
            auth: '/document/manager/modify/:id',
          },
        },
        {
          path: 'detail/:id',
          name: 'document-manager-detail',
          component: () => import('@/views/document/manager/create/index.vue'),
          meta: {
            title: '档案查看',
            sidebar: false,
            activeMenu: '/document/manager',
            auth: '/document/manager/detail/:id',
          },
        },
      ],
    },
    {
      path: 'device',
      name: 'document-device',
      redirect: '/document/device',
      meta: {
        title: '设备管理',
        auth: '/document/device',
      },
      children: [
        {
          path: '',
          name: 'document-device-list',
          component: () => import('@/views/document/device/index.vue'),
          meta: {
            title: '设备管理',
            sidebar: false,
            breadcrumb: false,
            activeMenu: '/document/device',
          },
        },
        {
          path: 'detail/:id',
          name: 'document-device-detail',
          component: () => import('@/views/document/device/detail/index.vue'),
          meta: {
            title: '设备详情',
            sidebar: false,
            activeMenu: '/document/device',
            auth: '/document/device/detail/:id',
          },
        },
      ],
    },
  ],
}

export default routes
